package com.example.web;

import com.example.common.util.IpUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
public class IpController {
    @ResponseBody
    @RequestMapping("/ip")
    public String hello(HttpServletRequest request){

        String realIP = IpUtil.getRealIP(request);

        return "hello:"+realIP;
    }
}
